<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="k" uri="/WEB-INF/k.tld"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>怀才进销存管理软件 - 销售前台</title>
		<jsp:include page="../inc.jsp"></jsp:include>
		<link href="../web/css/style.css" rel="stylesheet" type="text/css" />
		<SCRIPT language="JavaScript" type="text/javascript" src="../web/js/hdm.js"></SCRIPT>
		<SCRIPT>
		var calendar;
		var datagrid;
		$(function(){
		
			calendar = $('#calendar').calendar({
				fit : true,
				current : new Date(),
				border : false,
				onSelect : function(date) {
					$(this).calendar('moveTo', new Date());
				}
			});
			
			datagrid = $('#datagrid').datagrid({
				url : '${pageContext.request.contextPath}/kcgl/goodsAmountAction!datagrid.html',
				title : '库存列表',
				iconCls : 'icon-save',
				pagination : true,
				pagePosition : 'bottom',
				pageSize : 10,
				pageList : [ 10, 20, 30, 40 ],
				fit : true,
				fitColumns : false,
				nowrap : false,
				border : false,
				idField : 'id',
				sortName : 'name',
				sortOrder : 'desc',
				checkOnSelect : false,
				selectOnCheck : true,
				columns : [ [  {
					title : '商品条码',
					field : 'barcode',
					width : 100
				}, {
					title : '款号/款式',
					field : 'type',
					width : 100
				},{
					title : '单位',
					field : 'unit',
					width : 50
				}, {
					title : '颜色',
					field : 'color',
					width : 50
				}, {
					title : '尺码',
					field : 'size',
					width : 50
				}, {
					title : '库存总数',
					field : 'amount',
					width : 100
				}, {
					title : '所属仓库ID',
					field : 'rid',
					width : 50,
					hidden : true
				}, {
					title : '仓库名称',
					field : 'rname',
					width : 100
				} , {
					title : '商品名称',
					field : 'name',
					width : 100
				}, {
					title : '品牌ID',
					field : 'bid',
					width : 50,
					hidden : true
				},  {
					title : '品牌',
					field : 'bname',
					width : 100
				}, {
					title : '吊牌价',
					field : 'showPrice',
					width : 100
				}, {
					title : '总金额',
					field : 'total',
					width : 100
				}] ]
			});
			
			var bid0 = $('#searchForm').find('input[name=bid]');
			var bid0Combobox = bid0.combobox({
				url : '${pageContext.request.contextPath}/spgl/brandAction!noAuth_combobox.html',
				valueField : 'id',
				textField : 'name',
				multiple : false,
				editable : false,
				panelHeight : 'auto',
				onLoadSuccess : function() {
					parent.$.messager.progress('close');
				}
			});
			
			var rid0 = $('#searchForm').find('input[name=rid]');
			var rid0Combobox = rid0.combobox({
				url : '${pageContext.request.contextPath}/rkgl/repertoryAction!noAuth_combobox.html',
				valueField : 'id',
				textField : 'name',
				multiple : false,
				editable : false,
				panelHeight : 'auto',
				onLoadSuccess : function() {
					parent.$.messager.progress('close');
				}
			});
			
		});
		
		function logout(){
			sy.messagerConfirm('请确认', '您确定要退出前台销售？', function(r) {
				if(r){
					$.ajax({
						url : '${pageContext.request.contextPath}/loginAction!logout.html',
						type : 'get',
						success:function(){
							self.location.reload();
							if(window.opener){
								opener.location = opener.location;
							}
							window.close();
						}
					});
				}
			});
		}
		
		function _search() {
			datagrid.datagrid('load', sy.serializeObject($('#searchForm')));
		}
		
		function cleanSearch() {
			datagrid.datagrid('load', {});
			$('#searchForm input').val('');
		}
		</SCRIPT>
	</head>

	<body>
		<div class="top">
			<div class="logo">
				<img src="../web/imgs/htlogo.jpg" width="480" height="47" />
			</div>
			<div class="right">
				欢迎您！${sessionInfo.loginName} [${sessionInfo.roleNames}]
				<a href="javascript:void(0)" onclick="logout()">退出登录</a>
				<a href="#">修改密码</a>
			</div>
		</div>
		<div class="content">
			<div class="right">
				<!--日历标题-->
				<div class="title">
					<img src="../web/imgs/pic1.gif" width="6" height="6" />
					日历
				</div>
				<!--/日历标题-->
				<!--日历-->
				<div style="height:180px;">
					<div id="calendar"></div>
				</div>
				<!--/日历-->
				<!--公告+提醒-->
				<div class="title">
					<ul>
						<li id="cp1" class="cpover" onMouseOver="setTab_('cp',1,5,'cpover')">
							公告<span class="tabRefresh"><a href="javascript:void(0);" onclick="javascript:document.frames('announcementIframe').location.reload()" class="icon-mini-refresh"></a></span>
						</li>
						<li id="cp2" onMouseOver="setTab_('cp',2,5,'cpover')">
							系统提醒<span class="tabRefresh"><a href="javascript:void(0);" onclick="javascript:document.frames('warnIframe').location.reload()" class="icon-mini-refresh"></a></span>
						</li>
					</ul>
				</div>
				<div class="conts">
					<div id="cp_con1">
						<iframe width="100%" scrolling="auto" frameborder="0" onload="javascript:void(0);" name="announcementIframe" id="announcementIframe" src="${pageContext.request.contextPath}/qtmk/announcementAction!noAuth_tabAnnounce.html"></iframe>
					</div>
					<div id="cp_con2" style="display: none;">
						<iframe width="100%" scrolling="no"  frameborder="0" onload="javascript:void(0);" name="warnIframe" id="warnIframe" src="${pageContext.request.contextPath}/qtmk/remindWarnAction!noAuth_tabRemindWarn.html"></iframe>
					</div>
				</div>
				<!--/公告+提醒-->
			</div>
			<div class="left">
				<div class="nav">
					<ul>
						<k:security key="XSGL_QTXS">
						<li>
							<a href="${pageContext.request.contextPath}/xsgl/sale.html">
								<img src="${pageContext.request.contextPath}/web/imgs/navxsgl.jpg" width="104" height="35" /> 
							</a>
						</li>
						</k:security>
						<k:security key="XSGL_XSTH">
						<li>
							<a href="${pageContext.request.contextPath}/xsgl/saleReturn.html">
								<img src="${pageContext.request.contextPath}/web/imgs/nav-xsth.jpg" width="104" height="35" /> 
							</a>
						</li>
						</k:security>
						<k:security key="XSGL_KCCX">
						<li>
							<a href="${pageContext.request.contextPath}/xsgl/amount.html">
								<img src="${pageContext.request.contextPath}/web/imgs/nav-kcgl.jpg" width="104" height="35" /> 
							</a>
						</li>
						</k:security>
						<k:security key="XSGL_HYGL">
						<li>
							<a href="${pageContext.request.contextPath}/xsgl/member.html">
								<img src="${pageContext.request.contextPath}/web/imgs/nav-hygl.jpg" width="104" height="35" /> 
							</a>
						</li>
						</k:security>
						<k:security key="XSGL_RJQS">
						<li>
							<a href="${pageContext.request.contextPath}/xsgl/settlement.html">
								<img src="${pageContext.request.contextPath}/web/imgs/nav-rjqs.jpg" width="104" height="35" /> 
							</a>
						</li>
						</k:security>
						<k:security key="XSGL_XSJLCX">
						<li>
							<a href="${pageContext.request.contextPath}/xsgl/salelist.html">
								<img src="../web/imgs/navxsglcx.jpg" height="35" /> 
							</a>
						</li>
						</k:security>
					</ul>
				</div>
				<div class="cont">
					<div style="height: 120px; overflow: hidden;">
						<form id="searchForm">
							<table class="" style="width: 100%; height: 100%;">
								<tr>
									<th style="width: 80px;">商品条码</th>
									<td style="width: 200px;"><input name="barcode" style="width: 200px;"  class="input1"/></td>
									<th style="width: 80px;">款号/款式</th>
									<td style="width: 200px;"><input name="type" style="width: 200px;"  class="input1"/></td>
									<th style="width: 80px;">颜色</th>
									<td style="width: 200px;"><input name="color" style="width: 200px;"  class="input1"/></td>
								</tr>
								<tr>
									<th>尺码</th>
									<td><input name="size" style="width: 200px;"  class="input1"/></td>
									<th>所属仓库</th>
									<td><input name="rid" style="width: 200px;"  class="input1"/></td>
									<th>品牌</th>
									<td><input name="bid" style="width: 200px;"  class="input1"/></td>
								</tr>
								<tr>
									<td colspan="6" align="right" style=" padding:8px 0 4px 480px;">
										<a href="javascript:void(0);" class="button2 dis_block fl"
											onclick="_search();">搜索</a> <a href="javascript:void(0);"
											class="button3 dis_block fl m_l" onclick="cleanSearch();">取消</a>
									</td>
								</tr>
							</table>
						</form>
					</div>
					<div style="overflow: hidden;height:400px;">
						<table id="datagrid"></table>
					</div>
				</div>
			</div>
		</div>
		<div class="foot">
			Copyright @ 2013
			<a style="color:#FFFFFF; text-decoration:none;" target="_blank" href="http://www.miitbeian.gov.cn">浙ICP备13002014号-1</a>
			<br>
			杭州怀才商贸有限公司 
		</div>
	</body>
</html>
